$(function() {
	admin.homemakingOrder.init();
});
Namespace('admin.homemakingOrder', {
	init : function() {
		easyui.util.initDatagrid('#datagrid', {
			onDblClickRow : function() {
				var row = $('#datagrid').datagrid('getSelected');
				admin.homemakingOrder.detail(row.orderNo);
			}
		});
	},
	query : function() {
		if (!$('#query-form').form('validate'))
			return;
		var data = $('#query-form').form('jsonObject');
		$('#datagrid').datagrid('load', data);
	},
	detail:function(id) {
		if (id != null) {
			var row = $('#datagrid').datagrid('getSelected');
			top.addTab(id,'订单详情', contextPath+'/homemaking/order/detail?orderNo=' + row.orderNo);
		}
	}
});